var Public = {
    popup_timer:null,
    popup_interval:5000
};
//弹出消息
Public.popup = function(msg)
{
    var _self = this;
    if(_self.popup_timer!=null){
        clearTimeout(_self.popup_timer);
    }
    $('#popup').html(msg).stop().animate({top:0},300,function(){
            _self.popup_timer = setTimeout(function(){
                $('#popup').animate({top:'-200px'},300);
            },_self.popup_interval);
    });
}
//获取当前时间
Public.nowStr = function()
{
    var now = new Date(),
        y = now.getFullYear(),
        m = now.getMonth()+ 1,
        d = now.getDate(),
        h = now.getHours(),
        min = now.getMinutes(),
        sec = now.getSeconds();
    m = m<10?"0"+m:m;
    d = d<10?"0"+d:d;
    h = h<10?"0"+h:h;
    min = min<10?"0"+min:min;
    sec = sec<10?"0"+sec:sec;
    return y+"-"+m+"-"+d+" "+h+":"+min+":"+sec;
}
Public.getChNum = function(num)
{
    var chNum = "";
    switch(num){
        case 0 : chNum = "零";break;
        case 1 : chNum = "一";break;
        case 2 : chNum = "二";break;
        case 3 : chNum = "三";break;
        case 4 : chNum = "四";break;
        case 5 : chNum = "五";break;
        case 6 : chNum = "六";break;
        case 7 : chNum = "七";break;
        case 8 : chNum = "八";break;
        case 9 : chNum = "九";break;
        default:break;
    }
    return chNum;
}
//随机获取数组中个一个
Public.random = function(arr)
{
    var max = arr.length,
        index = Math.floor(Math.random()*max),
        lucky = arr[index];
    return lucky;
}